<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: DeciderUWBIRED Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00080.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-static-methods">Static Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">DeciderUWBIRED Class Reference<div class="ingroups"><a class="el" href="a00524.html">IEEE 802.15.4A - Classes that implement the IEEE 802.15.4A UWB PHY.</a> &#124; <a class="el" href="a00512.html">decider - decider modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="DeciderUWBIRED" --><!-- doxytag: inherits="BaseDecider" -->
<p>This class implements a model of an energy detection receiver that demodulates UWB-IR burst position modulation as defined in the <a class="el" href="a00099.html" title="This class regroups static methods needed to generate a pulse-level representation of an IEEE 802...">IEEE802154A</a> standard (mandatory mode, high PRF).  
 <a href="a00080.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00467_source.html">DeciderUWBIRED.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DeciderUWBIRED:</div>
<div class="dyncontent">
<div class="center"><img src="a00719.png" border="0" usemap="#DeciderUWBIRED_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for DeciderUWBIRED:</div>
<div class="dyncontent">
<div class="center"><img src="a00720.png" border="0" usemap="#DeciderUWBIRED_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00721.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#aea537e08fe1735faa06ae4f26ee30d9c">UWBIRED_CTRL_KIND</a> { <b>SYNC_SUCCESS</b> = MacToPhyInterface::LAST_BASE_PHY_KIND+1, 
<b>SYNC_FAILURE</b>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Control message kinds specific to <a class="el" href="a00080.html" title="This class implements a model of an energy detection receiver that demodulates UWB-IR burst position ...">DeciderUWBIRED</a>. Currently defines a message kind that informs the MAC of a successful SYNC event at PHY layer. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67c3982d6fb1d23d3e7ab24ac47b5c96"></a><!-- doxytag: member="DeciderUWBIRED::DeciderUWBIRED" ref="a67c3982d6fb1d23d3e7ab24ac47b5c96" args="(DeciderToPhyInterface *phy, double sensitivity, int myIndex, bool debug)" -->
&#160;</td><td class="memItemRight" valign="bottom"><b>DeciderUWBIRED</b> (<a class="el" href="a00079.html">DeciderToPhyInterface</a> *<a class="el" href="a00070.html#ac0f72556cb799d883b4219cab58320bb">phy</a>, double <a class="el" href="a00020.html#a5eece8bf532f92912ccbd0a3bc4d6fb0">sensitivity</a>, int <a class="el" href="a00020.html#a33e7f02028e78116193d09d6cdbc987e">myIndex</a>, bool <a class="el" href="a00020.html#aa22cd5156240713e37578172ba5557ce">debug</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a544bf3b2eecdf476feceed30bb6e4f72">initFromMap</a> (const <a class="el" href="a00070.html#a7f3ee545f2ae8b0d8d1814c98917f5b6">ParameterMap</a> &amp;params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the decider from XML map data.  <a href="#a544bf3b2eecdf476feceed30bb6e4f72"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a89d9bc072325f61bf90cdbe1b5f0eacd"></a><!-- doxytag: member="DeciderUWBIRED::getAvgThreshold" ref="a89d9bc072325f61bf90cdbe1b5f0eacd" args="() const " -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>getAvgThreshold</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77df8526aff34e04d52f35b3113065e0"></a><!-- doxytag: member="DeciderUWBIRED::cancelProcessSignal" ref="a77df8526aff34e04d52f35b3113065e0" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a77df8526aff34e04d52f35b3113065e0">cancelProcessSignal</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Cancels processing a AirFrame. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e918d4b8af6b850b52437f40eefc55a"></a><!-- doxytag: member="DeciderUWBIRED::finish" ref="a2e918d4b8af6b850b52437f40eefc55a" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a2e918d4b8af6b850b52437f40eefc55a">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Method to be called by an OMNeT-module during its own <a class="el" href="a00080.html#a2e918d4b8af6b850b52437f40eefc55a" title="Method to be called by an OMNeT-module during its own finish(), to enable a decider to do some things...">finish()</a>, to enable a decider to do some things. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00044.html">ChannelState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#afa82a8d2406cc58c21057561bc7af138">getChannelState</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A function that returns information about the channel state.  <a href="#afa82a8d2406cc58c21057561bc7af138"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa30cba820c929bb70124ca98d20a9af0"></a><!-- doxytag: member="DeciderUWBIRED::getNoiseValue" ref="aa30cba820c929bb70124ca98d20a9af0" args="()" -->
static double&#160;</td><td class="memItemRight" valign="bottom"><b>getNoiseValue</b> ()</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ea6df6903891318b6d15881f1908984"></a><!-- doxytag: member="DeciderUWBIRED::catUWBIRPacketSignal" ref="a1ea6df6903891318b6d15881f1908984" args="" -->
static const <a class="el" href="a00201.html">simsignalwrap_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a1ea6df6903891318b6d15881f1908984">catUWBIRPacketSignal</a> = <a class="el" href="a00201.html">simsignalwrap_t</a>( &quot;org.mixim.modules.utility.uwbirpacket&quot; )</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> for emitting UWBIR packets. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa00ea1df1692da3497bb3815da574d0e"></a><!-- doxytag: member="DeciderUWBIRED::noiseVariance" ref="aa00ea1df1692da3497bb3815da574d0e" args="" -->
static const double&#160;</td><td class="memItemRight" valign="bottom"><b>noiseVariance</b> = 101.085E-12</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add289afbae9259165ff366f45fb045f7"></a><!-- doxytag: member="DeciderUWBIRED::peakPulsePower" ref="add289afbae9259165ff366f45fb045f7" args="" -->
static const double&#160;</td><td class="memItemRight" valign="bottom"><b>peakPulsePower</b> = 1.3E-3</td></tr>
<tr><td colspan="2"><h2><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a652dcb740180e4ddbf7f774abfae5214"></a><!-- doxytag: member="DeciderUWBIRED::tSignalMap" ref="a652dcb740180e4ddbf7f774abfae5214" args="" -->
typedef std::map&lt; <a class="el" href="a00192.html">Signal</a> *, int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>tSignalMap</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e994d0155901d5d0819803c671b5fc2"></a><!-- doxytag: member="DeciderUWBIRED::MultipliedMapping" ref="a8e994d0155901d5d0819803c671b5fc2" args="" -->
typedef <a class="el" href="a00049.html">ConcatConstMapping</a><br class="typebreak"/>
&lt; std::multiplies&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>MultipliedMapping</b></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa">eSignalState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a8f260e182096aa6e810512b06046af35">getNextSignalState</a> (<a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa">eSignalState</a> CurState) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next signal state (END, HEADER, NEW).  <a href="#a8f260e182096aa6e810512b06046af35"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a675e00e69e4b9627552bbd8cc2da4cd5">getNextSignalHandleTime</a> (const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next handle time for scheduler.  <a href="#a675e00e69e4b9627552bbd8cc2da4cd5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#abe90eb371a8c63e71b6e550c93994b75">processSignalHeader</a> (<a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Processes the end of the header of a received <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>.  <a href="#abe90eb371a8c63e71b6e550c93994b75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00075.html">DeciderResult</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#ac3ab3f2532249d7784907f0b3cb601a6">createResult</a> (const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the passed completed AirFrame was received correctly.  <a href="#ac3ab3f2532249d7784907f0b3cb601a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a746aaa18a8eb887d62ba77eaa4880189"></a><!-- doxytag: member="DeciderUWBIRED::decodePacket" ref="a746aaa18a8eb887d62ba77eaa4880189" args="(const airframe_ptr_t frame, std::vector&lt; bool &gt; *receivedBits, const IEEE802154A::config &amp;cfg) const " -->
std::pair&lt; bool, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>decodePacket</b> (const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame, std::vector&lt; bool &gt; *receivedBits, const <a class="el" href="a00051.html">IEEE802154A::config</a> &amp;cfg) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa1226a47780904d237702cf95059de53"></a><!-- doxytag: member="DeciderUWBIRED::attemptSync" ref="aa1226a47780904d237702cf95059de53" args="(const airframe_ptr_t frame)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>attemptSync</b> (const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame)</td></tr>
<tr><td colspan="2"><h2><a name="pro-static-methods"></a>
Static Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab080bd1069c9e573ba68a5ea51fd97e"></a><!-- doxytag: member="DeciderUWBIRED::integrateWindow" ref="aab080bd1069c9e573ba68a5ea51fd97e" args="(int symbol, simtime_t_cref now, simtime_t_cref burst, const AirFrameVector &amp;airFrameVector, const ConstMapping *const signalPower, const airframe_ptr_t frame, const IEEE802154A::config &amp;cfg)" -->
static std::pair&lt; double, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>integrateWindow</b> (int symbol, simtime_t_cref now, simtime_t_cref burst, const <a class="el" href="a00070.html#a6baab300e0bec90320dfe956c2d15a57">AirFrameVector</a> &amp;airFrameVector, const <a class="el" href="a00058.html">ConstMapping</a> *const signalPower, const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame, const <a class="el" href="a00051.html">IEEE802154A::config</a> &amp;cfg)</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02ba8c4f4a1492b5e7332acbb168a1bc"></a><!-- doxytag: member="DeciderUWBIRED::syncThreshold" ref="a02ba8c4f4a1492b5e7332acbb168a1bc" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>syncThreshold</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02efd67a817853ec274209ae0f10fea6"></a><!-- doxytag: member="DeciderUWBIRED::syncAlwaysSucceeds" ref="a02efd67a817853ec274209ae0f10fea6" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>syncAlwaysSucceeds</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d79510e7db251e80820263772666198"></a><!-- doxytag: member="DeciderUWBIRED::channelSensing" ref="a0d79510e7db251e80820263772666198" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>channelSensing</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a57476e093cbf998d82eafd2df77f2d84"></a><!-- doxytag: member="DeciderUWBIRED::synced" ref="a57476e093cbf998d82eafd2df77f2d84" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>synced</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d684c8f8eabbff3b6b58715d264d8a2"></a><!-- doxytag: member="DeciderUWBIRED::alwaysFailOnDataInterference" ref="a4d684c8f8eabbff3b6b58715d264d8a2" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>alwaysFailOnDataInterference</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a322f62e224da879b0a67b38f629e6d76"></a><!-- doxytag: member="DeciderUWBIRED::packet" ref="a322f62e224da879b0a67b38f629e6d76" args="" -->
<a class="el" href="a00225.html">UWBIRPacket</a>&#160;</td><td class="memItemRight" valign="bottom"><b>packet</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8145084e8d57ff15e23629064e23d278"></a><!-- doxytag: member="DeciderUWBIRED::receivedPulses" ref="a8145084e8d57ff15e23629064e23d278" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>receivedPulses</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a479acc9997a81e432aab171b3343ae3c"></a><!-- doxytag: member="DeciderUWBIRED::syncThresholds" ref="a479acc9997a81e432aab171b3343ae3c" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>syncThresholds</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ec2196fbffb4ca888f04a98a4b4164a"></a><!-- doxytag: member="DeciderUWBIRED::uwbiface" ref="a1ec2196fbffb4ca888f04a98a4b4164a" args="" -->
<a class="el" href="a00175.html">PhyLayerUWBIR</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>uwbiface</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa90bb4ac347cda368b0d23deaa4db785"></a><!-- doxytag: member="DeciderUWBIRED::nbCancelReceptions" ref="aa90bb4ac347cda368b0d23deaa4db785" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>nbCancelReceptions</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7bb87516be12602830523baa4cdaa838"></a><!-- doxytag: member="DeciderUWBIRED::nbFinishTrackingFrames" ref="a7bb87516be12602830523baa4cdaa838" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>nbFinishTrackingFrames</b></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af4a8a4d958e6ea73f3215bfdbdc20f36"></a><!-- doxytag: member="DeciderUWBIRED::DeciderUWBIRED" ref="af4a8a4d958e6ea73f3215bfdbdc20f36" args="(const DeciderUWBIRED &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#af4a8a4d958e6ea73f3215bfdbdc20f36">DeciderUWBIRED</a> (const <a class="el" href="a00080.html">DeciderUWBIRED</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2eaeef3b2e8ea944f1178e0e8fe237f0"></a><!-- doxytag: member="DeciderUWBIRED::operator=" ref="a2eaeef3b2e8ea944f1178e0e8fe237f0" args="(const DeciderUWBIRED &amp;)" -->
<a class="el" href="a00080.html">DeciderUWBIRED</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#a2eaeef3b2e8ea944f1178e0e8fe237f0">operator=</a> (const <a class="el" href="a00080.html">DeciderUWBIRED</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af26b1910ad40768a2ce725cadca94968"></a><!-- doxytag: member="DeciderUWBIRED::trace" ref="af26b1910ad40768a2ce725cadca94968" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>trace</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae81f336197ccc9da69809f35359b77ce"></a><!-- doxytag: member="DeciderUWBIRED::stats" ref="ae81f336197ccc9da69809f35359b77ce" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>stats</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a957620335b5b6a78816c8fcc098a1302"></a><!-- doxytag: member="DeciderUWBIRED::nbFailedSyncs" ref="a957620335b5b6a78816c8fcc098a1302" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbFailedSyncs</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1f4df1b424ae5c47b2cb8374e77f505"></a><!-- doxytag: member="DeciderUWBIRED::nbSuccessfulSyncs" ref="ae1f4df1b424ae5c47b2cb8374e77f505" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbSuccessfulSyncs</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae78637acd6f7ea1c496b54565ab20a95"></a><!-- doxytag: member="DeciderUWBIRED::nbSymbols" ref="ae78637acd6f7ea1c496b54565ab20a95" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>nbSymbols</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f58be78ef63af1f7ba09d4dcfbed0c3"></a><!-- doxytag: member="DeciderUWBIRED::allThresholds" ref="a8f58be78ef63af1f7ba09d4dcfbed0c3" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>allThresholds</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afbeb57100a5f2c4cfac6b826e90fed7d"></a><!-- doxytag: member="DeciderUWBIRED::vsignal2" ref="afbeb57100a5f2c4cfac6b826e90fed7d" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>vsignal2</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a57dca84639daf044bf9955db2c38c0"></a><!-- doxytag: member="DeciderUWBIRED::pulseSnrs" ref="a5a57dca84639daf044bf9955db2c38c0" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>pulseSnrs</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class implements a model of an energy detection receiver that demodulates UWB-IR burst position modulation as defined in the <a class="el" href="a00099.html" title="This class regroups static methods needed to generate a pulse-level representation of an IEEE 802...">IEEE802154A</a> standard (mandatory mode, high PRF). </p>
<p>The code modeling the frame clock synchronization is implemented in attemptSync(). Simply subclass this class and redefine attemptSync() if you wish to consider more sophisticated synchronization models.</p>
<p>To implement a coherent receiver, the easiest way to start is to copy-paste this code into a new class and rename it accordingly. Then, redefine decodePacket().</p>
<p>Citation of the following publication is appreciated if you use the MiXiM UWB PHY model for a publication of your own. J. Rousselot, J.-D. Decotignie, An ultra-wideband impulse radio PHY layer model for network simulation. SIMULATION January 2011 vol. 87 no. 1-2 82-112.</p>
<p>For more information, see also:</p>
<p>[1] J. Rousselot, J.-D. Decotignie, An ultra-wideband impulse radio PHY layer model for network simulation. SIMULATION January 2011 vol. 87 no. 1-2 82-112. <a href="http://dx.doi.org/10.1177/0037549710377767">http://dx.doi.org/10.1177/0037549710377767</a> [2] J. Rousselot, Ultra Low Power Communication Protocols for UWB Impulse Radio Wireless Sensor Networks. EPFL Thesis 4720, 2010. <a href="http://infoscience.epfl.ch/record/147987">http://infoscience.epfl.ch/record/147987</a> [3] A High-Precision Ultra Wideband Impulse Radio Physical Layer Model for Network Simulation, Jérôme Rousselot, Jean-Dominique Decotignie, Second International Omnet++ Workshop,Simu'TOOLS, Rome, 6 Mar 09. <a href="http://portal.acm.org/citation.cfm?id=1537714">http://portal.acm.org/citation.cfm?id=1537714</a> </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac3ab3f2532249d7784907f0b3cb601a6"></a><!-- doxytag: member="DeciderUWBIRED::createResult" ref="ac3ab3f2532249d7784907f0b3cb601a6" args="(const airframe_ptr_t frame) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00075.html">DeciderResult</a> * DeciderUWBIRED::createResult </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a>&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if the passed completed AirFrame was received correctly. </p>
<p>Returns the result as a <a class="el" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a></p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The result of the decider for the passed AirFrame. </dd></dl>

<p>Reimplemented from <a class="el" href="a00020.html#ac6ef3a4cf1b91bcec788b540d61bfeba">BaseDecider</a>.</p>

<p>References <a class="el" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3">BaseDecider::currentSignal</a>, and <a class="el" href="a00215.html#a9e1a097b36bb1ae3338001b8af83d691">BaseDecider::tProcessingSignal::first</a>.</p>
<div class="fragment"><pre class="fragment">                                                                            {
  <span class="keywordflow">if</span> (<a class="code" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3" title="Pointer to the currently received AirFrame.">currentSignal</a>.<a class="code" href="a00215.html#a9e1a097b36bb1ae3338001b8af83d691" title="second_type is the second bound type">first</a> == frame) {
    ++nbFinishTrackingFrames;
    vector&lt;bool&gt;*           receivedBits   = <span class="keyword">new</span> vector&lt;bool&gt;();
    AirFrameUWBIR*          frameuwb       = check_and_cast&lt;AirFrameUWBIR*&gt;(frame);
    std::pair&lt;bool, double&gt; pairCorrectSnr = decodePacket(frame, receivedBits, frameuwb-&gt;getCfg());
    <span class="comment">// we cannot compute bit error rate here</span>
    <span class="comment">// so we send the packet to the MAC layer which will compare receivedBits</span>
    <span class="comment">// with the actual bits sent (stored in the encapsulated UWBIRMacPkt object).</span>
    <a class="code" href="a00078.html" title="This class stores results from an UWBIR Decider. It allows to pass to the MAC layer the demodulate bi...">DeciderResultUWBIR</a> * result = <span class="keyword">new</span> <a class="code" href="a00078.html" title="This class stores results from an UWBIR Decider. It allows to pass to the MAC layer the demodulate bi...">DeciderResultUWBIR</a>(pairCorrectSnr.first &amp;&amp; !frame-&gt;hasBitError(), receivedBits, pairCorrectSnr.second);

    uwbiface-&gt;switchRadioToSync();
    <span class="keywordflow">return</span> result;
  }
  <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="afa82a8d2406cc58c21057561bc7af138"></a><!-- doxytag: member="DeciderUWBIRED::getChannelState" ref="afa82a8d2406cc58c21057561bc7af138" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00044.html">ChannelState</a> DeciderUWBIRED::getChannelState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A function that returns information about the channel state. </p>
<p>It is an alternative for the MACLayer in order to obtain information immediately (in contrast to sending a ChannelSenseRequest, i.e. sending a cMessage over the OMNeT-control-channel) </p>

<p>Reimplemented from <a class="el" href="a00020.html#a35e3f8f4e683747fbec1618ee1608982">BaseDecider</a>.</p>
<div class="fragment"><pre class="fragment">                                                   {
  <span class="keywordflow">return</span> <a class="code" href="a00044.html" title="Provides information about the current state of the channel:">ChannelState</a>(<span class="keyword">true</span>, 0);  <span class="comment">// channel is always &quot;sensed&quot; free</span>
}
</pre></div>
</div>
</div>
<a class="anchor" id="a675e00e69e4b9627552bbd8cc2da4cd5"></a><!-- doxytag: member="DeciderUWBIRED::getNextSignalHandleTime" ref="a675e00e69e4b9627552bbd8cc2da4cd5" args="(const airframe_ptr_t frame) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">simtime_t DeciderUWBIRED::getNextSignalHandleTime </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a>&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the next handle time for scheduler. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">frame</td><td>The current frame which is in processing. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The next scheduler handle time. </dd></dl>

<p>Reimplemented from <a class="el" href="a00020.html#a5e45eb03d1a7f3653385181236714f21">BaseDecider</a>.</p>

<p>References <a class="el" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3">BaseDecider::currentSignal</a>, <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6">BaseDecider::EXPECT_HEADER</a>, <a class="el" href="a00215.html#a9e1a097b36bb1ae3338001b8af83d691">BaseDecider::tProcessingSignal::first</a>, <a class="el" href="a00020.html#a53c0ec4fdf4f47e54fc1e8c757a18f91">BaseDecider::getSignalState()</a>, <a class="el" href="a00099.html#affd046f553e39d7b550e45a337cb3f4d">IEEE802154A::mandatory_preambleLength</a>, <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaa3276f47da7417662597b21ee3afa2d31">BaseDecider::NEW</a>, and <a class="el" href="a00138.html#a2cf7c04c0adea7f6e9fe49101b0197c3">MappingUtils::pre()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                  {
    <span class="keywordflow">if</span> (frame != <a class="code" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3" title="Pointer to the currently received AirFrame.">currentSignal</a>.<a class="code" href="a00215.html#a9e1a097b36bb1ae3338001b8af83d691" title="second_type is the second bound type">first</a>)
        <span class="keywordflow">return</span> <a class="code" href="a00080.html#a675e00e69e4b9627552bbd8cc2da4cd5" title="Returns the next handle time for scheduler.">BaseDecider::getNextSignalHandleTime</a>(frame);

    <span class="keywordflow">switch</span>(<a class="code" href="a00020.html#a53c0ec4fdf4f47e54fc1e8c757a18f91" title="Returns the SignalState for the passed AirFrame.">getSignalState</a>(frame)) {
        <span class="keywordflow">case</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaa3276f47da7417662597b21ee3afa2d31" title="Signal is received the first time.">NEW</a>:           <span class="keywordflow">return</span> <a class="code" href="a00080.html#a675e00e69e4b9627552bbd8cc2da4cd5" title="Returns the next handle time for scheduler.">BaseDecider::getNextSignalHandleTime</a>(frame); <span class="keywordflow">break</span>;
        <span class="keywordflow">case</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6" title="Waiting for the header of the signal.">EXPECT_HEADER</a>: {
            simtime_t tHandleTime = frame-&gt;getSignal().getReceptionStart() + <a class="code" href="a00099.html#affd046f553e39d7b550e45a337cb3f4d" title="default sync preamble length">IEEE802154A::mandatory_preambleLength</a>;
            <span class="keywordflow">if</span> (tHandleTime &lt; frame-&gt;getSignal().getReceptionEnd())
                <span class="keywordflow">return</span> tHandleTime;
            <span class="keywordflow">return</span> <a class="code" href="a00138.html#a2cf7c04c0adea7f6e9fe49101b0197c3" title="returns the closest value of simtime before passed value">MappingUtils::pre</a>(frame-&gt;getSignal().getReceptionEnd());
        } <span class="keywordflow">break</span>;
        <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
    }
    <span class="keywordflow">return</span> <a class="code" href="a00080.html#a675e00e69e4b9627552bbd8cc2da4cd5" title="Returns the next handle time for scheduler.">BaseDecider::getNextSignalHandleTime</a>(frame);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a8f260e182096aa6e810512b06046af35"></a><!-- doxytag: member="DeciderUWBIRED::getNextSignalState" ref="a8f260e182096aa6e810512b06046af35" args="(eSignalState CurState) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa">eSignalState</a> DeciderUWBIRED::getNextSignalState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa">eSignalState</a>&#160;</td>
          <td class="paramname"><em>CurState</em></td><td>)</td>
          <td> const<code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the next signal state (END, HEADER, NEW). </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">CurState</td><td>The current signal state. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The next signal state. </dd></dl>

<p>Reimplemented from <a class="el" href="a00020.html#a4a8ddbaf158b593d4aabeac39c1d36ad">BaseDecider</a>.</p>

<p>References <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6">BaseDecider::EXPECT_HEADER</a>, and <a class="el" href="a00020.html#a4a8ddbaf158b593d4aabeac39c1d36ad">BaseDecider::getNextSignalState()</a>.</p>

<p>Referenced by <a class="el" href="a00080.html#abe90eb371a8c63e71b6e550c93994b75">processSignalHeader()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                       {
    <span class="keywordflow">switch</span>(CurState) {
      <span class="keywordflow">case</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaa3276f47da7417662597b21ee3afa2d31" title="Signal is received the first time.">NEW</a>:           <span class="keywordflow">return</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6" title="Waiting for the header of the signal.">EXPECT_HEADER</a>;                             <span class="keywordflow">break</span>;
      <span class="keywordflow">default</span>:            <span class="keywordflow">break</span>;
    }
    <span class="keywordflow">return</span> <a class="code" href="a00080.html#a8f260e182096aa6e810512b06046af35" title="Returns the next signal state (END, HEADER, NEW).">BaseDecider::getNextSignalState</a>(CurState);
  }
</pre></div>
</div>
</div>
<a class="anchor" id="a544bf3b2eecdf476feceed30bb6e4f72"></a><!-- doxytag: member="DeciderUWBIRED::initFromMap" ref="a544bf3b2eecdf476feceed30bb6e4f72" args="(const ParameterMap &amp;params)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool DeciderUWBIRED::initFromMap </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00070.html#a7f3ee545f2ae8b0d8d1814c98917f5b6">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the decider from XML map data. </p>
<p>This method should be defined for generic decider initialization.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The parameter map which was filled by XML reader.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the initialization was successfully. </dd></dl>

<p>Reimplemented from <a class="el" href="a00070.html#ae19a201633e5b2bf2d545921049b4f26">Decider</a>.</p>

<p>Reimplemented in <a class="el" href="a00082.html#a7c51e2dc6a5fbb0a73c4d25bef5c2a4c">DeciderUWBIREDSyncOnAddress</a>, and <a class="el" href="a00081.html#a7b5fbb75266417f8bf5ac1d81fd86d32">DeciderUWBIREDSync</a>.</p>

<p>References <a class="el" href="a00080.html#a1ea6df6903891318b6d15881f1908984">catUWBIRPacketSignal</a>, and <a class="el" href="a00201.html#aa01f017b96087bc252445206777e0080">simsignalwrap_t::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">                                                           {
    <span class="keywordtype">bool</span>                         bInitSuccess = <span class="keyword">true</span>;
    ParameterMap::const_iterator it           = params.find(<span class="stringliteral">&quot;syncThreshold&quot;</span>);
    <span class="keywordflow">if</span>(it != params.end()) {
        syncThreshold = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No syncThreshold defined in config.xml for DeciderUWBIREDSync!&quot;</span>);
    }
    it = params.find(<span class="stringliteral">&quot;stats&quot;</span>);
    <span class="keywordflow">if</span>(it != params.end()) {
        stats = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No stats defined in config.xml for DeciderUWBIREDSync!&quot;</span>);
    }
    it = params.find(<span class="stringliteral">&quot;trace&quot;</span>);
    <span class="keywordflow">if</span>(it != params.end()) {
        trace = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No trace defined in config.xml for DeciderUWBIREDSync!&quot;</span>);
    }
    it = params.find(<span class="stringliteral">&quot;syncAlwaysSucceeds&quot;</span>);
    <span class="keywordflow">if</span>(it != params.end()) {
        syncAlwaysSucceeds = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No syncAlwaysSucceeds defined in config.xml for DeciderUWBIREDSync!&quot;</span>);
    }
    it = params.find(<span class="stringliteral">&quot;alwaysFailOnDataInterference&quot;</span>);
    <span class="keywordflow">if</span>(it != params.end()) {
        alwaysFailOnDataInterference = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        alwaysFailOnDataInterference = <span class="keyword">false</span>;
    }

    <a class="code" href="a00080.html#a1ea6df6903891318b6d15881f1908984" title="Signal for emitting UWBIR packets.">catUWBIRPacketSignal</a>.<a class="code" href="a00201.html#aa01f017b96087bc252445206777e0080">initialize</a>();

    <span class="keywordflow">return</span> <a class="code" href="a00080.html#a544bf3b2eecdf476feceed30bb6e4f72" title="Initialize the decider from XML map data.">BaseDecider::initFromMap</a>(params) &amp;&amp; bInitSuccess;
}
</pre></div>
</div>
</div>
<a class="anchor" id="abe90eb371a8c63e71b6e550c93994b75"></a><!-- doxytag: member="DeciderUWBIRED::processSignalHeader" ref="abe90eb371a8c63e71b6e550c93994b75" args="(airframe_ptr_t frame)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">simtime_t DeciderUWBIRED::processSignalHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a>&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Processes the end of the header of a received <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>. </p>
<p>Returns the time it wants to handle the signal again.</p>
<p>Default implementation does not handle signal headers. </p>

<p>Reimplemented from <a class="el" href="a00020.html#ab53849078ba0481ea80a8926bdedd5f0">BaseDecider</a>.</p>

<p>References <a class="el" href="a00080.html#a1ea6df6903891318b6d15881f1908984">catUWBIRPacketSignal</a>, <a class="el" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3">BaseDecider::currentSignal</a>, <a class="el" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6">BaseDecider::EXPECT_HEADER</a>, <a class="el" href="a00080.html#a8f260e182096aa6e810512b06046af35">getNextSignalState()</a>, <a class="el" href="a00029.html#a893db61c894236b50c4c56e569ceedbb">BasePhyLayer::getRadioState()</a>, and <a class="el" href="a00079.html#a319e413b963f03ff218b0d0024fb66b9">DeciderToPhyInterface::sendControlMsgToMac()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                  {

  <span class="keywordtype">int</span> currState = uwbiface-&gt;<a class="code" href="a00029.html#a893db61c894236b50c4c56e569ceedbb" title="Returns the current state the radio is in.">getRadioState</a>();

  <span class="keywordflow">if</span> (<a class="code" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3" title="Pointer to the currently received AirFrame.">currentSignal</a>.isProcessing() &amp;&amp; currState == RadioUWBIR::SYNC) {
    <span class="comment">// We are not tracking a signal currently.</span>
    <span class="comment">// Can we synchronize on this one ?</span>

    <span class="keywordtype">bool</span> isSyncSignalHigherThanThreshold;
    <span class="keywordflow">if</span>(syncAlwaysSucceeds) {
      isSyncSignalHigherThanThreshold = <span class="keyword">true</span>;
    } <span class="keywordflow">else</span> {
      isSyncSignalHigherThanThreshold = attemptSync(frame);
    }

    packet.setNbSyncAttempts(packet.getNbSyncAttempts() + 1);

    <span class="keywordflow">if</span>(isSyncSignalHigherThanThreshold) {
      ++nbSuccessfulSyncs;
      uwbiface-&gt;switchRadioToRX();
      packet.setNbSyncSuccesses(packet.getNbSyncSuccesses() + 1);
      <span class="comment">// notify MAC layer through PHY layer</span>
      cMessage* syncSuccessfulNotification = <span class="keyword">new</span> cMessage(<span class="stringliteral">&quot;Ctrl_PHY2MAC_Sync_Success&quot;</span>, SYNC_SUCCESS);
      <a class="code" href="a00070.html#ac0f72556cb799d883b4219cab58320bb" title="A pointer to the physical layer of this Decider.">phy</a>-&gt;<a class="code" href="a00079.html#a319e413b963f03ff218b0d0024fb66b9" title="Called by the Decider to send a control message to the MACLayer.">sendControlMsgToMac</a>(syncSuccessfulNotification);

      <span class="comment">// in any case, look at that frame again when it is finished</span>
      <span class="comment">// store this frame as signal to receive and set state</span>
      setSignalState(frame, <a class="code" href="a00080.html#a8f260e182096aa6e810512b06046af35" title="Returns the next signal state (END, HEADER, NEW).">getNextSignalState</a>(<a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6" title="Waiting for the header of the signal.">EXPECT_HEADER</a>));
    } <span class="keywordflow">else</span> {
      ++nbFailedSyncs;
      cMessage* syncFailureNotification = <span class="keyword">new</span> cMessage(<span class="stringliteral">&quot;Ctrl_PHY2MAC_Sync_Failure&quot;</span>, SYNC_FAILURE);
      <a class="code" href="a00070.html#ac0f72556cb799d883b4219cab58320bb" title="A pointer to the physical layer of this Decider.">phy</a>-&gt;<a class="code" href="a00079.html#a319e413b963f03ff218b0d0024fb66b9" title="Called by the Decider to send a control message to the MACLayer.">sendControlMsgToMac</a>(syncFailureNotification);

      <a class="code" href="a00020.html#a22e578e992fab5ab54fe5fcdf196d9e3" title="Pointer to the currently received AirFrame.">currentSignal</a>.finishProcessing();
    }
    uwbiface-&gt;emit(<a class="code" href="a00080.html#a1ea6df6903891318b6d15881f1908984" title="Signal for emitting UWBIR packets.">catUWBIRPacketSignal</a>, &amp;packet);

  }

  <span class="keywordflow">return</span> frame-&gt;getSignal().getReceptionEnd();
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/<a class="el" href="a00467_source.html">DeciderUWBIRED.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/DeciderUWBIRED.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00080.html">DeciderUWBIRED</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
